<% layout('layout.html') -%>

<% if (q) { %>
  <section id="search_result">
    <% if (count > 0) { %>
      <h1><%- __('search: WAX Score of SITE', q.h()) %>: <b id="search_result_score"><%= avg %></b></h1>
      <ul>
        <% for (var i = 0; i < list.length; i++) { %>
          <li><a href="<%= list[i].url %>">
              <%= list[i].title %></a>:
            <b><%= list[i].score %></b>
            (<%= list[i].updated_at.humantime(getLocale()) %>)<br />
            <span class="addr"><%= list[i].url %></span></li>
        <% } %>
      </ul>
    <% } else { %>
      <h1><%- __('search: No result with SITE', q.h()) %></h1>
      <p><%- __('search: Redirect SITE and run', (!/^https?:\/\//.test(q) ? 'http://' : '') + q, q) %></p>
    <% } %>
  </section>
<% } else { %>
  <section>
    <h1><%= __('search: Do search') %></h1>
    <p><%= __('search: Input URL to check WAX Score') %></p>
  </section>
<% } %>
